<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@include file="getusersession.jsp"%>
<%
request.setCharacterEncoding("GB2312");
%>
<jsp:useBean id="addcollection" scope="page" class="dsp.web.Collection"/>
<jsp:setProperty name="addcollection" property="name" param="name"/>
<%
String url = request.getParameter("url");
if(url.indexOf("http://") == -1){
	url = "http://"  + url;
}
addcollection.setUrl(url);
addcollection.setUsername(String.valueOf(session.getAttribute("username")));
addcollection.addCollection();
if(addcollection.isStatus()){
	response.setHeader("Pragma", "no-cache");
	response.setHeader("Expires", "0");
	response.sendRedirect("collection.jsp");
}
else{
	out.println("<script language=javascript> alert('"+ addcollection.getMsg() + "'); location.href='collection.jsp';</script>");	
}
%>